<template>
  <div>
    <div class="modal">
      <div class="modal-bg" @click="closeFollowss"></div>
      <div class="Htran">
        <div class="rele-titles"><img @click="closeFollowss"src="../assets/img/tub.png" alt="">跟进客源</div>
        <div class="li-p">
          <div class="Htran-li">
            <div class="Htran-b-li">
              <div class="Htran-b-name">
                跟进方式
              </div>
              <div class="Htran-b-input">
                <select v-model="FollowValue" placeholder="请选择" style="width: 250%;height: 28px;border: 1px solid #a0a0a0;cursor: pointer;">
                  <option
                    v-for="item in Follow"
                    :key="item.id"
                    :label="item.title"
                    :value="item.id">
                  </option>
                </select>
              </div>
            </div>
            <div class="Htran-b-li">
              <div class="Htran-b-name">
                跟进内容
              </div>
              <div class="Htran-b-input">
                <el-input
                  type="textarea"
                  :rows="6"
                  placeholder="请输入内容"
                  v-model="textarea" style="width:250%;border: 1px solid #a0a0a0;">
                </el-input>
              </div>
            </div>
          </div>
          <div class="primary_link">
            <div class="primary_link_name">
              <el-button @click="submi" type="primary" style="margin-top: 230px; margin-left: 2px;position: absolute">保存</el-button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script type="text/babel">
  export default {
    props:{
      SetHourList:{
        type:Function
      },
      TFollowClose:{
        type:Function
      },
      genjinID:{
        type:Number
      },
      closeFollows:{
        type:Function
      },
      LDmodal:{
        type:Function
      }
    },
    data () {
      return {
        timevalue2:"",
        timevalue1:"",
        HtranClose:"",
        textarea:"",
        FollowValue:"",
        Follow:[]
      }
    },
    computed:{
      // SSid(){
      //   return this.ids
      // }
    },
    methods: {
      closeFollowss(){
        let that = this;
        that.closeFollows();
        that.FollowValue ='';
        that.textarea = '';
      },
      submi(){
        let that = this;
        this.$http.post('/newapi/Touristsvisit/add',{
          tourists_id:that.genjinID,
          visit_type:that.FollowValue,
          visit_desc:that.textarea})
          .then(function(res) {
            if(res.data.status === 200){
              that.closeFollowss();

              that.SetHourList(1);
              that.$store.state.messageString = res.data.message;
              that.LDmodal();
            }else {
              that.$store.state.messageString = res.data.message;
              that.LDmodal();
              console.log(that.genjinID)
            }
          })
          .catch(function(err) { console.log(err);
          })
      }
    },
    mounted:function(){
      // 跟进方式列表
      let that = this;
      this.$http.get('/newapi/Touristsvisitmode/index')
        .then(function(res) {
          that.Follow = res.data.res.Touristsvisitmodes
        })
        .catch(function(err) { console.log(err);
        })
    },
  }
</script>
<style scoped>
  .primary_link {
    text-align: center;
    width: 58%;
  }

  .Htran-b-name{
    width: 35%;
    text-align: center;
    float: left;
    line-height: 27px;
  }
  .Htran-b-input{
    width: 65%;
    float: left;
  }
  .Htran-bu-input{
    width: 65%;
    float: left;
  }
  .Htran-b-input input{
    width: 100%;
    line-height: 27px;
    box-sizing: border-box;
    border: 1px solid  #d3d3d3;
  }
  .li-p{
    width: 94%;
    float: left;
    padding: 0 3%;
    margin-top: 58px;
  }
  .Htran-b-li{
    margin-top: 10px;
    width: 100%;
    float: left;
  }
  .Htran-li{
    margin-top: 15px;
    width: 50%;
    float: left;
  }
  .Htran-input{
    width: 80%;
    float: left;
  }
  .Htran-input input{
    width: 100%;
    float: left;
    border:none;
    line-height: 27px;
    border-bottom: 1px solid  #d3d3d3;
    cursor: pointer;
  }
  .Htran-tltle{
    width: 90%;
    margin-top: 20px;
    line-height: 27px;
    font-size: 1.1em;
    float: left;
    padding: 0 5%;
  }
  .Htran{
    width: 26%;
    height: 360px;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    position:absolute;
    top: 50%;
    margin-top: -180px;
    left: 37%;
    z-index: 10;
    box-shadow: #e8e7e7 0px 0px 10px;
  }
  img:hover {
    background: #bd2c00 !important;
    color: #ffffff;
  }
  img{
    /*position: fixed;*/
    flex-star:40px;
    /*margin-left: 44%;*/
    position: relative;
    border-radius: 10px;
    cursor: pointer;

  }
  img{
    left: 158%;
  }
  .rele-titles {
    width: 14.8%;
    line-height: 50px;
    color: #000;
    background: #f5f5f7;
    position: fixed;
    z-index: 9;
    border-bottom: 1px solid #d3d3d3;
    padding-right: 200px;
  }
</style>
